def solve(a,b):
    # 辗转相除法求最大公约数和最小公倍数
    a1, b1 = a, b
    res = a1 % b1
    while res != 0:
        a1 = b1
        b1 = res
        res = a1 % b1
    print("最大公约数为：" + str(b1) +"\n"+ "最小公倍数为：" + str(a * b / b1))
if __name__ == '__main__':
    a, b = map(int, input("输入两个数:").split())
    solve(a,b)
